package com.adl.entity.listener;

import com.adl.entity.Member;
import com.adl.entity.Orders;

import javax.persistence.PreRemove;

/**
 * Created by Adiljan on 2017-06-18.
 */

public class MemberListener {
    @PreRemove
    public void PreRemove(Member member) {
        System.out.println("OK PreRemove");
        for (Orders orders : member.getOrders()) {
            orders.setMember(null);
        }
    }
}
